﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Globalization;

namespace Barbar.MapReport.Common {
  /// <summary>
  /// Obecná vyjímka v Map Reportu
  /// </summary>
  [Serializable]
  public class MapReportException : Exception {
    /// <summary>
    /// Výchozí konstruktor
    /// </summary>
    public MapReportException() {
    }

    /// <summary>
    /// Výchozí konstruktor
    /// </summary>
    /// <param name="message"></param>
    public MapReportException(string message)
      : base(message) {
    }

    /// <summary>
    /// Výchozí konstruktor
    /// </summary>
    /// <param name="message"></param>
    /// <param name="innerException"></param>
    public MapReportException(string message, Exception innerException)
      : base(message, innerException) {
    }


    /// <summary>
    /// Serializařní konstruktor
    /// </summary>
    /// <param name="info"></param>
    /// <param name="context"></param>
    protected MapReportException(SerializationInfo info, StreamingContext context) : base(info, context) {
    }

    public static MapReportException CreateException(string format, params object[] args) {
      return new MapReportException(String.Format(CultureInfo.InvariantCulture, format, args));
    }
  }
}
